<!--<?php
print <<<EOT
-->
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:291px;
	top:52px;
	width:248px;
	height:93px;
	z-index:10;
}
.leftmenu td{
	height:28px;
	color:#333333;
	padding-left:30px;
	background-image:url(images/admin/bg_menu.png);
	background-repeat:no-repeat;
}
.leftmenu a{
	color:#9c8d6b;
	text-decoration:none;
}
.leftH td {
	color:#333;
	padding:2px 0px 3px 20px;
	text-align: left;color:#000000;
	font-size:14px;
	height:25px;
	background:#e6f5ff;
	font-weight:bold;
}
-->
</style>
<link href="images/tree/xtree.css" rel="stylesheet" type="text/css" />
<link href="images/tree/xmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="images/tree/xtree.js"></script>
<script type="text/javascript" src="images/tree/xmlextras.js"></script>
<script type="text/javascript" src="images/tree/xloadtree.js"></script>
<SCRIPT src="images/tree/xmenu.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript>
var elo;
var loadmenuok=false;
var type = 'main';
function goMain(action) {
	var main = parent.mainFrame;
	var top=parent.topFrame;
	top.document.getElementById('loadMsg').style.display='';
	main.location=action; 
}
function goNew(action){
	window.open(action);
	return;
}
function goDel(action){
	var msg = confirm('您确定要删除此目录么？删除之后所有目录下数据都将丢失!');
	if(msg){
		goMain(action);
		return;
	}else{
		return;
	}
	
}
function rightMenu(cid) {
	var toolMenu = new WebFXMenu;
	toolMenu.width = 90;
	if(cid == 'root')  {
		toolMenu.add(new WebFXMenuItem('新建目录','javascript:goMain("$admin_file?adminjob=category&action=add")','新建目录'));
		toolMenu.add(new WebFXMenuItem('统计{$very[contentName]}','javascript:goMain("$admin_file?adminjob=category&action=total")','统计{$very[contentName]}数'));
		//toolMenu.add(new WebFXMenuItem('更新首页','javascript:goMain("$admin_file?adminjob=category&action=pubindex")','更新首页'));
		//toolMenu.add(new WebFXMenuItem('目录管理','javascript:goMain("$admin_file?adminjob=category&action=edit")','目录管理'));
		//toolMenu.add(new WebFXMenuItem('{$very[contentName]}查看','javascript:goMain("$admin_file?adminjob=content")','{$very[contentName]}查看'));
	} else {
		toolMenu.add(new WebFXMenuItem('添加新{$very[contentName]}','javascript:goMain("$admin_file?adminjob=edit&action=add&cid='+ cid +'")','新建文档'));
		//toolMenu.add(new WebFXMenuItem('查看此首页','javascript:goNew("$admin_file?adminjob=category&action=viewlist&cid='+ cid +'")','查看首页'));
		//toolMenu.add(new WebFXMenuItem('更新此首页','javascript:goMain("$admin_file?adminjob=category&action=publist&cid='+ cid +'")', '更新目录首页'));
		toolMenu.add(new WebFXMenuItem('设置本目录','javascript:goMain("$admin_file?adminjob=category&action=edit&action=edit&cid='+ cid +'")','目录设置'));
		toolMenu.add(new WebFXMenuItem('添加子目录','javascript:goMain("$admin_file?adminjob=category&action=add&up='+ cid +'")','添加子目录'));
		//toolMenu.add(new WebFXMenuItem('发布此目录','javascript:goMain("$admin_file?adminjob=category&action=pubview&cid='+ cid +'")', '发布此目录'));
		//toolMenu.add(new WebFXMenuItem('更新此目录','javascript:goMain("$admin_file?adminjob=category&action=pubupdate&cid='+ cid +'")', '更新此目录'));
		toolMenu.add(new WebFXMenuItem('删除此目录','javascript:goDel("$admin_file?adminjob=category&action=del&cid='+ cid +'")', '删除此目录'));
	}
		//var menudata = document.getElementById('menudata');
		menudata.innerHTML = toolMenu ;

		elo=window.event.srcElement;
		toolMenu.left = window.event.clientX;
		toolMenu.top = window.event.clientY+document.body.scrollTop;
		toolMenu.show();	

}
/// XP Look
webFXTreeConfig.rootIcon		= "images/tree/xp/folder.png";
webFXTreeConfig.openRootIcon	= "images/tree/xp/openfolder.png";
webFXTreeConfig.folderIcon		= "images/tree/xp/folder.png";
webFXTreeConfig.openFolderIcon	= "images/tree/xp/openfolder.png";
webFXTreeConfig.fileIcon		= "images/tree/xp/file.png";
webFXTreeConfig.lMinusIcon		= "images/tree/xp/Lminus.png";
webFXTreeConfig.lPlusIcon		= "images/tree/xp/Lplus.png";
webFXTreeConfig.tMinusIcon		= "images/tree/xp/Tminus.png";
webFXTreeConfig.tPlusIcon		= "images/tree/xp/Tplus.png";
webFXTreeConfig.iIcon			= "images/tree/xp/I.png";
webFXTreeConfig.lIcon			= "images/tree/xp/L.png";
webFXTreeConfig.tIcon			= "images/tree/xp/T.png";


var rti;
var tree = new WebFXTree("Root");
<!--
EOT;
while($cate=$db->fetch_array($root)){
if(count($children[$cate[cid]])>0){
print <<<EOT
-->
	tree.add(new WebFXLoadTreeItem("$cate[cname]", "$admin_file?adminjob=tree&action=showXML&cid=$cate[cid]","javascript:goMain('$admin_file?adminjob=content&action=view&cid=$cate[cid]');","$cate[cid]"));
<!--
EOT;
}else{
print <<<EOT
-->
tree.add(new WebFXTreeItem("$cate[cname]","javascript:goMain('$admin_file?adminjob=content&action=view&cid=$cate[cid]');","$cate[cid]"));
<!--
EOT;
}}
print <<<EOT
-->	
</script>
<div class="m"></div>
<div id="menus" style="margin:0 5px 0 5px;">
<div class="t">
<table border="0" cellspacing="0" cellpadding="0" width=100%>
  <tr class="leftH">
    <td>站点目录管理</td>
  </tr>
  <tr class="tr">
  	<td style="text-align:left"><a href="javascript:goMain('$admin_file?adminjob=category');"><img src="images/admin/page_nav.png" hspace="2" style="vertical-align:middle;" />目录结构</a> &nbsp;<a href="javascript:goMain('$admin_file?adminjob=content');"><img src="images/admin/page_view.png" hspace="2" style="vertical-align:middle;margin-left:3px;" />目录{$very[contentName]}</a></td>
  </tr>
  <tr class="tr3"><td>
<script>
document.write(tree);
</script>
  </td>
  </tr>
</table>
</div>
</div>
<div id="menudata">
</div>
<!--
EOT;
?>-->